<!-- 首页 -->
<template>
	<view class="page-index-index">
		<u-navbar :is-back="false" title="首页"></u-navbar>
		
		<view class=" u-p-30 bold u-font-40 u-text-center">
			Hello World~
		</view>
		<image :src="staticUrl+'/images/big-picture.png'"></image>
		
	</view>
</template>

<script>
export default {
	data() {
		return {  
			options:{},
			goodsList:[],
			page:null,
		}
	}, 
	onLoad(options) {
		this.options=options;
		// uni.$u.get("/xxx").then((res)=>{}); 
		// uni.$u.vuex('userInfo',{nickname:"张三"});
		// uni.$api.user.login({code:'xxxx'})
		
	},
	onShow(){},
	methods: {
		research(){//初始化分页，仅支持ThinkPHP,Laravel
			this.page=uni.$func.initPage();
			this.goodsList=new Array();
			this.search();
		},
		search(){
			let page=uni.$func.nextPage(this.page);
			if(!page)return ;//没有下一页
			page.keyword="";
			uni.$api.goods.query(page).then((res)=>{
				if(res.code==200){
					this.goodsList=this.goodsList.concat(res.data.data);
					this.page=res.data;
				}
			})
		}
	},
	onShareAppMessage(res){
		return {
			title: '',
			path:"/pages/index/index"
		}
	},
	
	onReachBottom(){},
	
}
</script>

<style lang="scss">
	.page-index-index{ 
		text-align: left;
		.btn-main{
			width:40vw ;
			margin:30upx 5vw;
		}
	}
</style>
